﻿using FastDFSCore.Protocols;
using FileStorageCenter.Services.Models;

namespace HelenServer.Modules.FileStorage.Abstractions;

public interface IFileStorageService
{
    ValueTask<OperationalResult<DownloadModel>> DownloadFileAsync(string fileid, CancellationToken cancellationToken = default);

    ValueTask<OperationalResult<FastDFSFileInfo>> GetFileInfo(string fileid);

    ValueTask<OperationalResult<StorageNode>> GetStorageNodeAsync(string fileid);

    ValueTask<OperationalResult<string>> GetTokenAsync(string fileid, DateTime? dateTime = null);

    ValueTask<IReadOnlyCollection<GroupInfo>> ListAllGroupInfosAsync();

    ValueTask<OperationalResult<GroupInfo>> ListOneGroupInfoAsync();

    ValueTask<IReadOnlyCollection<StorageInfo>> ListStorageInfosAsync();

    ValueTask<OperationalResult<StorageNode>> QueryStorageNodeForFileAsync(string fileid);

    ValueTask<IReadOnlyCollection<StorageNode>> QueryStorageNodesForFileAsync(string fileid);

    ValueTask<OperationalResult<bool>> RemoveFileAsync(string fileid);

    ValueTask<OperationalResult<string>> UploadFileAsync(UploadModel model, CancellationToken cancellationToken = default);

    ValueTask<OperationalResult<IReadOnlyCollection<string>>> UploadFileRangeAsync(IEnumerable<UploadModel> models, CancellationToken cancellationToken = default);
}